package com.caesar.exer2;

import java.util.Comparator;

/**
 * @author caesar
 * @date 2025/7/16
 * @Description:
 * @apiNote
 */
public class EmployeeAgeComparator implements Comparator<Employee> {
    @Override
    public int compare(Employee o1, Employee o2) {
        int result = o1.getAge() - o2.getAge();
        if(result == 0){
            result = o1.getId() - o2.getId();
        }
        return result;
    }
}
